<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"></meta>
    <title>dns信息</title>
    <link rel="stylesheet" type="text/css" href="../../easyui/themes/default/easyui.css"></link>
    <link rel="stylesheet" type="text/css" href="../../easyui/themes/icon.css"></link>
    <script type="text/javascript" src="../../easyui/jquery.min.js"></script>
    <script type="text/javascript" src="../../easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../easyui/locale/easyui-lang-zh_CN.js"></script>
</head>
<body class="easyui-layout">
<div data-options="region:'center'">
<table id="dg"></table>
</div>
<script>
    $(document).ready(function() {
        $("#dg").datagrid({
            url:'../dnsForPage',
            width: document.body.clientWidth*0.98,
            height: document.body.clientHeight*0.9,
            striped: true,
            fitColumns:true,
            rownumbers: true,
            singleSelect: true,
            nowrap: true,
            pagination: true,
            pageSize:20,//分页大小
            pageList:[20,50,100],//每页的个数
            columns: [[
                {field: "dnsAddress", title: "dns地址", width: 30,align:'left'},
                {field: "ip", title: "ip", width: 30,align:'left'},
                {field: "isNew", title: "是否最新采集", width: 30,align:'left',
                    formatter: function(value,row,index){
                        switch (value){
                            case 1: return "是";
                            case 0: return "否";
                            default: return "";
                        }
                    }
                },
                {field: "createTime", title: "采集时间", width: 30,align:'left'},
            ]]
        });
    });
    $(window).resize(function () {
        $('#dg').datagrid('resize',{
            width: document.body.clientWidth*0.98,
            height: document.body.clientHeight*0.9,
        });
    });
</script>
</body>
</html>